
import Foundation
import UIKit

//MARK: - 十六进制字符串转换成颜色
extension UIColor
{
    
    /// 将十六进制转换成UIColor
    /// - Parameter hex: 十六进制字符串
    /// - Returns: UIColor
  @objc  class func colorHex(_ hex : String) -> UIColor
    {
        return hex.color()
    }
    
    /// 将十六进制转换成UIColor
    /// - Parameters:
    ///   - hex: 十六进制字符串
    ///   - alpha: 透明值
    /// - Returns: UIColor
  @objc  class func colorHex(_ hex : String, _ alpha : Float) -> UIColor
    {
        return hex.color(alpha)
    }
    
    class func RGBA(_ R:Int, _ G : Int, _ B : Int, _ A : Int) -> UIColor
    {
        return UIColor.init(red:CGFloat(R) / 255.0, green:CGFloat(G) / 255.5, blue:CGFloat(B) / 255.0, alpha: CGFloat(A))
    }
    
    
}
